﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace Inovout.Account.Web.Models
{
    public class ChangePasswordInfo
    {
        public ChangePasswordInfo()
        { }
        public ChangePasswordInfo(string userName, string password)
        {
            UserName = userName;
            Password = password;
        }

        [Required(ErrorMessage = "用户名不可为空")]
        [Display(Name = "用户名")]
        public string UserName { get; set; }

        [Required(AllowEmptyStrings = false,ErrorMessage = "密码不可为空")]
        [DataType(DataType.Password)]
        [StringLength(20, ErrorMessage = "请输入6-20位的密码", MinimumLength = 6)]
        //[RegularExpression("^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,10}$", ErrorMessage = "请输入6-10位包含字母、数字的密码")]
        [Alias("密码")]
        public string Password { get; set; }

        [DataType(DataType.Password)]
        [Compare("Password",ErrorMessage = "密码不一致")]
        [Alias("确认密码")]
        public string ConfirmPassword { get; set; }
    }
}